<?php 
date_default_timezone_set("America/Lima");
$hoy = strftime('%Y-%m-%d');

function getUltimoDiaMes($elAnio,$elMes) {
  return date("d",(mktime(0,0,0,$elMes+1,1,$elAnio)-1));
}
?>